/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.yournamehere.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;

/**
 * Main entry point.
 *
 * @author BUSH
 */
public class MainEntryPoint implements EntryPoint {
    /** 
     * Creates a new instance of MainEntryPoint
     */
    public MainEntryPoint() {
    }

    /** 
     * The entry point method, called automatically by loading a module
     * that declares an implementing class as an entry-point
     */
    public void onModuleLoad() {
    final Button button = new Button("Haz Click!!");

    final Label label = new Label();



    button.addClickListener((ClickListener) new ClickListener() {

      public void onClick(Widget sender) {

        if (label.getText().equals(""))

          label.setText("Ajuaaaa!");

        else

          label.setText("");

      }
    });

    RootPanel.get("slot1").add(button);

    RootPanel.get("slot2").add(label);
  }
};

